package camel.server.session;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

@Entity
public class ModelSemaphore implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -1688439922401110433L;
	
	private int id;
	private boolean locked;
	private ParticipantCursor owner;
	private CollaborationSession session;
	
	public boolean isLocked() {
		return locked;
	}
	public void setLocked(boolean locked) {
		this.locked = locked;
	}
	
	@ManyToOne
	public ParticipantCursor getOwner() {
		return owner;
	}
	public void setOwner(ParticipantCursor owner) {
		this.owner = owner;
	}
	public void setId(int id) {
		this.id = id;
	}
	@Id
    @GeneratedValue(strategy = GenerationType.AUTO)
	public int getId() {
		return id;
	}
	public void setSession(CollaborationSession session) {
		this.session = session;
	}
	@ManyToOne
	public CollaborationSession getSession() {
		return session;
	}	
}
